<template>
  <div>
    <ul class="mui-table-view">
      <li class="mui-table-view-cell mui-media" v-for="(item, index) in msg" :key="index">
        <router-link :to="'/xinwen/Newsinof/'+item.id">
          <img class="mui-media-object mui-pull-left" :src="item.img_url" />
          <div class="mui-media-body">
            <p class="mui-ellipsis">{{item.title}}</p>
            <span class="mui-pull-left">发表时间 : {{item.add_time|dateFormat}}</span>
            <span class="mui-pull-right">点击: {{item.click}} 次</span>
          </div>
        </router-link>
      </li>
    </ul>
  </div>
</template>
<script>
export default {
  name: "tabbar-chat",
  data() {
    return {
      msg: ""
    };
  },
  methods: {
    Xinwen() {
      this.$ajax.get("/api/getnewslist").then(result => {
        this.msg = result.data.message;
      });
    }
  },
  created() {
    this.Xinwen();
  }
};
</script>
<style lang="scss" scoped>
.mui-table-view {
  li {
    span {
      font-size: 12px;
      color: rgb(126, 169, 235);
    }
    p {
      font-size: 14px;
      color: #000;
    }
  }
}
</style>
